﻿<Window x:Class="ProgressWheelDemo.MainWindow"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:toolkit="clr-namespace:Microsoft.Windows.Controls;assembly=WPFToolkit.Extended"
        xmlns:wheel="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
        xmlns:diagnostics="clr-namespace:System.Diagnostics;assembly=WindowsBase"
        xmlns:media="clr-namespace:System.Windows.Media;assembly=PresentationCore"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:local="clr-namespace:ProgressWheelDemo"
        mc:Ignorable="d" 
        xmlns:vm="clr-namespace:ProgressWheelDemo.ViewModel"
        Title="MainWindow" Height="550" Width="525"
        d:DataContext="{d:DesignInstance vm:MainViewModel,IsDesignTimeCreatable=True}"
        FontFamily="Trebuchet MS" FontSize="12" FontWeight="ExtraBlack"
        >
    <Window.Resources>
        <ObjectDataProvider ObjectInstance="{x:Type Colors}" MethodName="GetProperties" x:Key="colorPropertiesOdp" />
        <Style x:Key="WheelStyleExample" TargetType="wheel:ProgressWheel">
            <Setter Property="StylePreset" Value="MacOsx"/>
            <Setter Property="RotationSpeed" Value="{Binding Path=RotationSpeed}"/>
            <Setter Property="OuterCircleRadius" Value="45"/>
            <Setter Property="InnerCircleRadius" Value="6"/>
            <Setter Property="Color" Value="Red"/>
        </Style>
    </Window.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <StackPanel>
            <TextBlock Margin="10">Progress Wheel Demo</TextBlock>
            <Button Command="{Binding ActivateCommand}" Margin="2">Activate</Button>
            <Button Command="{Binding DeactivateCommand}" Margin="2">Deactivate</Button>
            <TextBlock Margin="10">Number of Spokes</TextBlock>
            <toolkit:IntegerUpDown Value="{Binding NumberOfSpokes}"></toolkit:IntegerUpDown>
            <TextBlock Margin="10">Spoke Thickness</TextBlock>
            <toolkit:IntegerUpDown Value="{Binding SpokeWidth}"></toolkit:IntegerUpDown>
            <TextBlock Margin="10">Inner Circle Radius</TextBlock>
            <toolkit:IntegerUpDown Value="{Binding InnerCircleRadius}"></toolkit:IntegerUpDown>
            <TextBlock Margin="10">Outer circle radius</TextBlock>
            <toolkit:IntegerUpDown Value="{Binding OuterCircleRadius}"></toolkit:IntegerUpDown>
            <TextBlock Margin="10">Rotation Speed</TextBlock>
            <toolkit:IntegerUpDown x:Name="_rotation" Value="{Binding Path=RotationSpeed}" ></toolkit:IntegerUpDown>
            <TextBlock Margin="10">Color</TextBlock>
            <ComboBox SelectedValue="{Binding Path=Color}" ItemsSource="{Binding Source={StaticResource colorPropertiesOdp}}" SelectedValuePath="Name" ></ComboBox>

            <Button Command="{Binding StyleCommand}" CommandParameter="{x:Static wheel:WheelStyle.Firefox}" Margin="2">Firefox</Button>
            <Button Command="{Binding StyleCommand}" CommandParameter="{x:Static wheel:WheelStyle.Ie7}" Margin="2">Ie7</Button>
            <Button Command="{Binding StyleCommand}" CommandParameter="{x:Static wheel:WheelStyle.MacOsx}"  Margin="2">Mac OSX</Button>
        </StackPanel>
        <StackPanel Grid.Column="1">
            <wheel:ProgressWheel  
                                 RotationSpeed="{Binding  RotationSpeed}" 
                                 Color="{Binding Path=Color}" 
                                 StylePreset="{Binding Path=Preset,Mode=TwoWay}" 
                                 Active="{Binding Path=Active}"
                                 OuterCircleRadius="{Binding Path=OuterCircleRadius,Mode=TwoWay, diagnostics:PresentationTraceSources.TraceLevel=High}" 
                                 InnerCircleRadius="{Binding Path=InnerCircleRadius,Mode=TwoWay}"
                                 NumberSpokes="{Binding Path=NumberOfSpokes,Mode=TwoWay}"
                                 SpokeThickness="{Binding Path=SpokeWidth,Mode=TwoWay}"
                                 Width="50" Height="50"></wheel:ProgressWheel>
            <wheel:ProgressWheel RotationSpeed="{Binding  RotationSpeed}" Color="{Binding Path=Color}" StylePreset="Firefox"  Active="{Binding Active}" Width="100" Height="100"></wheel:ProgressWheel>
            <wheel:ProgressWheel RotationSpeed="{Binding RotationSpeed}" Color="{Binding Path=Color}" StylePreset="MacOsx" Active="{Binding Active}" Width="100" Height="100"></wheel:ProgressWheel>
            <wheel:ProgressWheel RotationSpeed="{Binding RotationSpeed}" Color="{Binding Path=Color}" StylePreset="Ie7" Active="{Binding Active}" Width="100" Height="100"></wheel:ProgressWheel>
            <wheel:ProgressWheel Style="{StaticResource WheelStyleExample}"  Active="{Binding Active}" Width="100" Height="100"></wheel:ProgressWheel>
        </StackPanel>
    </Grid>
</Window>
